//
//  UMSocial.m
//  MUBATE
//
//  Created by sunbin on 2017/2/17.
//  Copyright © 2017年 Quanli. All rights reserved.
//

#import "UMSocial.h"
#import "WXApi.h"
#import "WXApiRequestHandler.h"


@implementation UMSocial
single_implementation(UMSocial);
// 分享的是连接
- (void)shareTy:(sharePlatform)ty fromeCtl:(UIViewController *)ctl sendLinkURL:(NSString *)linkURL TagName:(NSString *)tagName title:(NSString *)title description:(NSString *)description thumbImage:(UIImage *)thumbImage{

    // 微信分享操作 ty=0聊天界面 < 朋友圈 < 收藏
    if (ty<3) {
        if (![WXApi isWXAppInstalled])
        {
            NSLog(@"没有安装微信");
            [ctl.view showError:@"没有安装微信"];
            return;
        }
        BOOL isSuccessful = [WXApiRequestHandler sendLinkURL:linkURL
                                                     TagName:tagName
                                                       Title:title
                                                 Description:description
                                                  ThumbImage:thumbImage
                                                     InScene:ty];
        
        if (isSuccessful) {
            NSLog(@"isSuccessful");
        }else{
            NSLog(@"isFail");
        }
        return ;
    }
    
    if (ty == SceneSina) {
    
    
    }
}

















@end
